#include<iostream>
#include<string>

using namespace std;

int main()
{
    string s;
    getline(cin, s);

    int pos = 0;
    int run = pos;
    int max_pos = pos;
    int max_count = 0;
    while (run < s.size())
    {
        int count = 0;
        if (s[run] >= '1' && s[run] <= '9')
        {
            pos = run;
            while (run < s.size() && s[run] >= '1' && s[run] <= '9')
            {
                ++count;
                ++run;
            }
            if (count > max_count)
            {
                max_pos = pos;
                max_count = count;
            }
        }
        ++run;
    }
    cout << s.substr(max_pos, max_count) << endl;
    return 0;
}